<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkStyleProvider</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="theming.html" title="Part III. GTK+中的主题">
<link rel="prev" href="gtk3-GtkCssProvider.html" title="GtkCssProvider">
<link rel="next" href="gtk3-GtkStyleProperties.html" title="GtkStyleProperties">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkCssProvider.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="theming.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkStyleProperties.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkStyleProvider.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkStyleProvider.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkStyleProvider"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkStyleProvider.top_of_page"></a>GtkStyleProvider</span></h2>
<p>GtkStyleProvider — Interface to provide style information to GtkStyleContext</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkStyleProvider.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProviderIface" title="struct GtkStyleProviderIface">GtkStyleProviderIface</a>;
                    <a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider">GtkStyleProvider</a>;
#define             <a class="link" href="gtk3-GtkStyleProvider.html#GTK-STYLE-PROVIDER-PRIORITY-FALLBACK:CAPS" title="GTK_STYLE_PROVIDER_PRIORITY_FALLBACK">GTK_STYLE_PROVIDER_PRIORITY_FALLBACK</a>
#define             <a class="link" href="gtk3-GtkStyleProvider.html#GTK-STYLE-PROVIDER-PRIORITY-THEME:CAPS" title="GTK_STYLE_PROVIDER_PRIORITY_THEME">GTK_STYLE_PROVIDER_PRIORITY_THEME</a>
#define             <a class="link" href="gtk3-GtkStyleProvider.html#GTK-STYLE-PROVIDER-PRIORITY-SETTINGS:CAPS" title="GTK_STYLE_PROVIDER_PRIORITY_SETTINGS">GTK_STYLE_PROVIDER_PRIORITY_SETTINGS</a>
#define             <a class="link" href="gtk3-GtkStyleProvider.html#GTK-STYLE-PROVIDER-PRIORITY-APPLICATION:CAPS" title="GTK_STYLE_PROVIDER_PRIORITY_APPLICATION">GTK_STYLE_PROVIDER_PRIORITY_APPLICATION</a>
#define             <a class="link" href="gtk3-GtkStyleProvider.html#GTK-STYLE-PROVIDER-PRIORITY-USER:CAPS" title="GTK_STYLE_PROVIDER_PRIORITY_USER">GTK_STYLE_PROVIDER_PRIORITY_USER</a>
<a class="link" href="gtk3-Themeable-Stock-Images.html#GtkIconFactory" title="GtkIconFactory"><span class="returnvalue">GtkIconFactory</span></a> *    <a class="link" href="gtk3-GtkStyleProvider.html#gtk-style-provider-get-icon-factory" title="gtk_style_provider_get_icon_factory ()">gtk_style_provider_get_icon_factory</a> (<em class="parameter"><code><a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a> *provider</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> *path</code></em>);
<a class="link" href="gtk3-GtkStyleProperties.html#GtkStyleProperties" title="struct GtkStyleProperties"><span class="returnvalue">GtkStyleProperties</span></a> * <a class="link" href="gtk3-GtkStyleProvider.html#gtk-style-provider-get-style" title="gtk_style_provider_get_style ()">gtk_style_provider_get_style</a>       (<em class="parameter"><code><a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a> *provider</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> *path</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkStyleProvider.html#gtk-style-provider-get-style-property" title="gtk_style_provider_get_style_property ()">gtk_style_provider_get_style_property</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a> *provider</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> *path</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Standard-Enumerations.html#GtkStateFlags" title="enum GtkStateFlags"><span class="type">GtkStateFlags</span></a> state</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkStyleProvider.description"></a><h2>Description</h2>
<p>
GtkStyleProvider is an interface used to provide style information to a <a class="link" href="gtk3-GtkStyleContext.html#GtkStyleContext" title="struct GtkStyleContext"><span class="type">GtkStyleContext</span></a>.
See <a class="link" href="gtk3-GtkStyleContext.html#gtk-style-context-add-provider" title="gtk_style_context_add_provider ()"><code class="function">gtk_style_context_add_provider()</code></a> and <a class="link" href="gtk3-GtkStyleContext.html#gtk-style-context-add-provider-for-screen" title="gtk_style_context_add_provider_for_screen ()"><code class="function">gtk_style_context_add_provider_for_screen()</code></a>.
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkStyleProvider.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkStyleProviderIface"></a><h3>struct GtkStyleProviderIface</h3>
<pre class="programlisting">struct GtkStyleProviderIface {
  GTypeInterface g_iface;

  GtkStyleProperties * (* get_style) (GtkStyleProvider *provider,
                                      GtkWidgetPath    *path);

  gboolean (* get_style_property) (GtkStyleProvider *provider,
                                   GtkWidgetPath    *path,
                                   GtkStateFlags     state,
                                   GParamSpec       *pspec,
                                   GValue           *value);

  GtkIconFactory * (* get_icon_factory) (GtkStyleProvider *provider,
					 GtkWidgetPath    *path);
};
</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="../gobject/gobject-Type-Information.html#GTypeInterface"><span class="type">GTypeInterface</span></a> <em class="structfield"><code><a name="GtkStyleProviderIface.g-iface"></a>g_iface</code></em>;</span></p></td>
<td></td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GtkStyleProviderIface.get-style"></a>get_style</code></em> ()</span></p></td>
<td>Gets a set of style information that applies to a widget path.</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GtkStyleProviderIface.get-style-property"></a>get_style_property</code></em> ()</span></p></td>
<td>Gets the value of a widget style property that applies to a widget path.</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GtkStyleProviderIface.get-icon-factory"></a>get_icon_factory</code></em> ()</span></p></td>
<td>Gets the icon factory that applies to a widget path.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GtkStyleProvider"></a><h3>GtkStyleProvider</h3>
<pre class="programlisting">typedef struct _GtkStyleProvider GtkStyleProvider;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-STYLE-PROVIDER-PRIORITY-FALLBACK:CAPS"></a><h3>GTK_STYLE_PROVIDER_PRIORITY_FALLBACK</h3>
<pre class="programlisting">#define GTK_STYLE_PROVIDER_PRIORITY_FALLBACK      1
</pre>
<p>
The priority used for default style information
that is used in the absence of themes.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-STYLE-PROVIDER-PRIORITY-THEME:CAPS"></a><h3>GTK_STYLE_PROVIDER_PRIORITY_THEME</h3>
<pre class="programlisting">#define GTK_STYLE_PROVIDER_PRIORITY_THEME     200
</pre>
<p>
The priority used for style information provided
by themes.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-STYLE-PROVIDER-PRIORITY-SETTINGS:CAPS"></a><h3>GTK_STYLE_PROVIDER_PRIORITY_SETTINGS</h3>
<pre class="programlisting">#define GTK_STYLE_PROVIDER_PRIORITY_SETTINGS    400
</pre>
<p>
The priority used for style information provided
via <a class="link" href="gtk3-GtkSettings.html#GtkSettings" title="GtkSettings"><span class="type">GtkSettings</span></a>.
</p>
<p>
This priority is higher than <a class="link" href="gtk3-GtkStyleProvider.html#GTK-STYLE-PROVIDER-PRIORITY-THEME:CAPS" title="GTK_STYLE_PROVIDER_PRIORITY_THEME"><span class="type">GTK_STYLE_PROVIDER_PRIORITY_THEME</span></a>
to let settings override themes.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-STYLE-PROVIDER-PRIORITY-APPLICATION:CAPS"></a><h3>GTK_STYLE_PROVIDER_PRIORITY_APPLICATION</h3>
<pre class="programlisting">#define GTK_STYLE_PROVIDER_PRIORITY_APPLICATION 600
</pre>
<p>
A priority that can be used when adding a <a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a>
for application-specific style information.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-STYLE-PROVIDER-PRIORITY-USER:CAPS"></a><h3>GTK_STYLE_PROVIDER_PRIORITY_USER</h3>
<pre class="programlisting">#define GTK_STYLE_PROVIDER_PRIORITY_USER        800
</pre>
<p>
The priority used for the style information from
<code class="filename">~/.gtk-3.0.css</code>.
</p>
<p>
You should not use priorities higher than this, to
give the user the last word.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-style-provider-get-icon-factory"></a><h3>gtk_style_provider_get_icon_factory ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-Themeable-Stock-Images.html#GtkIconFactory" title="GtkIconFactory"><span class="returnvalue">GtkIconFactory</span></a> *    gtk_style_provider_get_icon_factory (<em class="parameter"><code><a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a> *provider</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> *path</code></em>);</pre>
<p>
Returns the <a class="link" href="gtk3-Themeable-Stock-Images.html#GtkIconFactory" title="GtkIconFactory"><span class="type">GtkIconFactory</span></a> defined to be in use for <em class="parameter"><code>path</code></em>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none
is defined.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>provider</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>
<a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> to query</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The icon factory to use for <em class="parameter"><code>path</code></em>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-style-provider-get-style"></a><h3>gtk_style_provider_get_style ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkStyleProperties.html#GtkStyleProperties" title="struct GtkStyleProperties"><span class="returnvalue">GtkStyleProperties</span></a> * gtk_style_provider_get_style       (<em class="parameter"><code><a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a> *provider</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> *path</code></em>);</pre>
<p>
Returns the style settings affecting a widget defined by <em class="parameter"><code>path</code></em>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if
<em class="parameter"><code>provider</code></em> doesn't contemplate styling <em class="parameter"><code>path</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>provider</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>
<a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> to query</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkStyleProperties.html#GtkStyleProperties" title="struct GtkStyleProperties"><span class="type">GtkStyleProperties</span></a> containing the
style settings affecting <em class="parameter"><code>path</code></em>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-style-provider-get-style-property"></a><h3>gtk_style_provider_get_style_property ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_style_provider_get_style_property
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a> *provider</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> *path</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Standard-Enumerations.html#GtkStateFlags" title="enum GtkStateFlags"><span class="type">GtkStateFlags</span></a> state</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre>
<p>
Looks up a widget style property as defined by <em class="parameter"><code>provider</code></em> for
the widget represented by <em class="parameter"><code>path</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>provider</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkStyleProvider.html#GtkStyleProvider" title="GtkStyleProvider"><span class="type">GtkStyleProvider</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>
<a class="link" href="gtk3-GtkWidgetPath.html#GtkWidgetPath" title="GtkWidgetPath"><span class="type">GtkWidgetPath</span></a> to query</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
<td>state to query the style property for</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pspec</code></em> :</span></p></td>
<td>The <a href="../gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> to query</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>return location for the property value. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the property was found and has a value, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="gtk3-GtkStyleProvider.see-also"></a><h2>See Also</h2>
<a class="link" href="gtk3-GtkStyleContext.html#GtkStyleContext" title="struct GtkStyleContext"><span class="type">GtkStyleContext</span></a>, <a class="link" href="gtk3-GtkCssProvider.html#GtkCssProvider" title="struct GtkCssProvider"><span class="type">GtkCssProvider</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>